#coding=utf-8
from zhaokelai.marketing.models import *
from django.contrib import admin

class incomeAdmin(admin.ModelAdmin):
    list_display = ('phonenum', 'customer','user','thetime')
    list_display_links = ('phonenum', 'customer','user','thetime')
    list_select_related=True
    list_per_page=30
    ordering=['-thetime']
    search_fields =['phonenum']
    
class callAdmin(admin.ModelAdmin):
    list_display = ('phonenum', 'customer','user','thetime')
    list_display_links = ('phonenum', 'customer','user','thetime')
    list_select_related=True
    list_per_page=30
    ordering=['-thetime']
    search_fields =['phonenum']    
    
class simsendAdmin(admin.ModelAdmin):
    list_display = ('mobile', 'customer','user','thetime')
    list_display_links = ('mobile', 'customer','user','thetime')
    list_select_related=True
    list_per_page=30
    ordering=['-thetime']
    search_fields =['mobile'] 
   
class emailsendAdmin(admin.ModelAdmin):
    list_display = ('email', 'customer','user','thetime')
    list_display_links = ('email', 'customer','user','thetime')
    list_select_related=True
    list_per_page=30
    ordering=['-thetime']
    search_fields =['email'] 


class call_missionAdmin(admin.ModelAdmin):
    list_display = ('phone','mobile','customer','actor','maker','btime','etime','status')
    list_display_links = ('phone', 'mobile','customer','actor','maker','btime','etime','status')
    list_select_related=True
    list_per_page=30
    ordering=['-status','etime']
    search_fields =['phone','mobile'] 

class sim_missionAdmin(admin.ModelAdmin):
    list_display = ('mobile','customer','actor','maker','btime','etime','status')
    list_display_links = ('mobile','customer','actor','maker','btime','etime','status')
    list_select_related=True
    list_per_page=30
    ordering=['-status','etime']
    search_fields =['mobile'] 

class email_missionAdmin(admin.ModelAdmin):
    list_display = ('email','customer','actor','maker','btime','etime','status')
    list_display_links = ('email','customer','actor','maker','btime','etime','status')
    list_select_related=True
    list_per_page=30
    ordering=['-status','etime']
    search_fields =['email','content'] 

    
admin.site.register(income,incomeAdmin)
admin.site.register(call,callAdmin)
admin.site.register(simsend,simsendAdmin)
admin.site.register(emailsend,emailsendAdmin)
admin.site.register(call_mission,call_missionAdmin)
admin.site.register(sim_mission,sim_missionAdmin)
admin.site.register(email_mission,email_missionAdmin)